package com.rwx.reflect;

import com.rwx.reflect.model.Student;

import java.lang.reflect.Constructor;

public class Reflect02 {

    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException {
        Class clazz=Class.forName("com.rwx.reflect.model.Student");
        Constructor[] constructors = clazz.getConstructors();
        for (Constructor c: constructors) {
            System.out.println(c);
        }
        System.out.println("=============================");
        Constructor[] constructors1 = clazz.getDeclaredConstructors();
        for (Constructor c1 : constructors1) {
            System.out.println(c1);
        }
        System.out.println("=============================");
        Constructor con1 = clazz.getConstructor();
        System.out.println(con1);
        System.out.println("=============================");
        Constructor con2 = clazz.getConstructor(String.class);
        System.out.println(con2);
        System.out.println("=============================");

        Constructor con3 = clazz.getDeclaredConstructor(String.class, String.class);
        System.out.println(con3);
        System.out.println("=============================");

















    }
}
